from xtreg.lib.base import *

import datetime
class PeopleController(BaseController):
    def index(self):
        c.people = model.Person.select(order_by='name')
        return render_response("/people/index.html")
    def calendar(self, id, year=None, month=None):
        if year is None and month is None:
            today = datetime.date.today()
            return h.redirect_to(year = today.year, month = today.month)
        else:
            c.year = int(year)
            c.month = int(month)
            c.person = model.Person.get(id)
            return render_response("/people/calendar.html")
